package com.work.model.builder;

import java.util.Date;

import com.work.model.User;

/**
 * The Class UserBuilder.
 *
 * @author "Mihai Roman"
 */
public class UserBuilder extends Builder<User>{
	
	/**
	 * With ck.
	 *
	 * @param ck the ck
	 * @return the user builder
	 */
	private UserBuilder withCK(String ck) {
		build().setCk(ck);
		return this;
	}
	
	/**
	 * With created by.
	 *
	 * @param createdBy the created by
	 * @return the user builder
	 */
	private UserBuilder withCreatedBy(int createdBy) {
		build().setCreatedBy(createdBy);
		return this;
	}
	
	/**
	 * With creation date.
	 *
	 * @param creationDate the creation date
	 * @return the user builder
	 */
	private UserBuilder withCreationDate(Date creationDate) {
		build().setCreationDate(creationDate);
		return this;
	}
	
	/**
	 * With email.
	 *
	 * @param email the email
	 * @return the user builder
	 */
	private UserBuilder withEmail(String email) {
		build().setEmail(email);
		return this;
	}
	
	/**
	 * With first name.
	 *
	 * @param firstName the first name
	 * @return the user builder
	 */
	private UserBuilder withFirstName(String firstName){
		build().setFirstName(firstName);
		return this;
	}
	
	/**
	 * With last name.
	 *
	 * @param lastName the last name
	 * @return the user builder
	 */
	private UserBuilder withLastName(String lastName) {
		build().setLastName(lastName);
		return this;
	}
	
	/**
	 * With role.
	 *
	 * @param role the role
	 * @return the user builder
	 */
	private UserBuilder withRole(int role) {
		build().setRole(role);
		return this;
	}
	
	/**
	 * With updated by.
	 *
	 * @param updatedBy the updated by
	 * @return the user builder
	 */
	private UserBuilder withUpdatedBy(int updatedBy) {
		build().setUpdatedBy(updatedBy);
		return this;
	}
	
	/**
	 * With updated date.
	 *
	 * @param updatedDate the updated date
	 * @return the user builder
	 */
	private UserBuilder withUpdatedDate(Date updatedDate) {
		build().setUpdatedDate(updatedDate);
		return this;
	}
	
	/**
	 * An user.
	 *
	 * @param ck the ck
	 * @param createdBy the created by
	 * @param creationDate the creation date
	 * @param email the email
	 * @param firstName the first name
	 * @param lastName the last name
	 * @param role the role
	 * @param updatedBy the updated by
	 * @param updatedDate the updated date
	 * @return the user
	 */
	public User anUser(String ck, int createdBy, Date creationDate, String email, String firstName, String lastName, int role, int updatedBy, Date updatedDate) {
		this.withCK(ck);
		this.withCreatedBy(createdBy);
		this.withCreationDate(creationDate);
		this.withEmail(email);
		this.withFirstName(firstName);
		this.withLastName(lastName);
		this.withRole(role);
		this.withUpdatedBy(updatedBy);
		this.withUpdatedDate(updatedDate);
		return this.build();
	}
	
}
